/*
 * Filename    : Text_Load.java
 * Projectname : RamaShinta
 * Date        : Nov 18, 2012 , 8:32:28 PM 
 * 
 * Class For Load Font
 * 
 * Super Class for text Package
 */

package com.amikomgamedev.ramashinta.text;

import org.andengine.engine.camera.hud.HUD;
import org.andengine.entity.scene.Scene;
import org.andengine.opengl.font.Font;
import org.andengine.opengl.font.FontFactory;
import org.andengine.opengl.font.FontManager;
import org.andengine.opengl.texture.TextureManager;
import org.andengine.opengl.texture.TextureOptions;
import org.andengine.opengl.vbo.VertexBufferObjectManager;
import org.andengine.ui.activity.BaseGameActivity;

import android.content.Context;
import android.content.res.AssetManager;

import com.amikomgamedev.ramashinta.game.Game_Data;
import com.amikomgamedev.ramashinta.game.Game_Define;
import com.amikomgamedev.ramashinta.graphic.Graphic_Detach;

public class Text_Load implements Text_Path, Text_Define, Game_Data, Game_Define
{
	protected BaseGameActivity	activity;
	protected Scene				m_Scene;
	protected HUD				m_Hud;
	protected Graphic_Detach	m_Graphic;

	protected Font				font_Small, font_Medium, font_Big;
	protected Font				font_Small_Candy, font_Medium_Candy, font_Big_Candy;

	public Text_Load(Context context, Scene scene, HUD hud, Graphic_Detach grafik)
	{
		activity = (BaseGameActivity) context;
		m_Scene = scene;
		m_Hud = hud;
		m_Graphic = grafik;
	}

	protected TextureManager getTextureManager()
	{
		return activity.getTextureManager();
	}

	protected FontManager getFontManager()
	{
		return activity.getFontManager();
	}

	protected AssetManager getAssetManager()
	{
		return activity.getAssets();

	}

	protected VertexBufferObjectManager getVertexBufferManager()
	{
		return activity.getVertexBufferObjectManager();

	}

	public void loadFontCandySmall()
	{
		if (font_Small_Candy != null)
			return;

		font_Small_Candy = FontFactory.createFromAsset(getFontManager(), getTextureManager(), FONT_WIDTH, FONT_HEIGHT,
				TextureOptions.BILINEAR_PREMULTIPLYALPHA, getAssetManager(), FONT_USE2, FONT_SMALL, true,
				android.graphics.Color.BLACK);
		font_Small_Candy.load();

	}

	public void loadFontCandyMedium()
	{
		if (font_Medium_Candy != null)
			return;

		font_Medium_Candy = FontFactory.createFromAsset(getFontManager(), getTextureManager(), FONT_WIDTH, FONT_HEIGHT,
				TextureOptions.BILINEAR_PREMULTIPLYALPHA, getAssetManager(), FONT_USE2, FONT_MEDIUM, true,
				android.graphics.Color.BLACK);
		font_Medium_Candy.load();

	}

	public void loadFontCandybig()
	{
		if (font_Big_Candy != null)
			return;

		font_Big_Candy = FontFactory.createFromAsset(getFontManager(), getTextureManager(), FONT_WIDTH, FONT_HEIGHT,
				TextureOptions.BILINEAR_PREMULTIPLYALPHA, getAssetManager(), FONT_USE2, FONT_BIG, true,
				android.graphics.Color.BLACK);
		font_Big_Candy.load();
	}
	
	public void loadFontSmall()
	{
		if (font_Small != null)
			return;

		font_Small = FontFactory.createFromAsset(getFontManager(), getTextureManager(), FONT_WIDTH, FONT_HEIGHT,
				TextureOptions.BILINEAR_PREMULTIPLYALPHA, getAssetManager(), FONT_USE, FONT_SMALL, true,
				android.graphics.Color.BLACK);
		font_Small.load();

	}

	public void loadFontMedium()
	{
		if (font_Medium != null)
			return;

		font_Medium = FontFactory.createFromAsset(getFontManager(), getTextureManager(), FONT_WIDTH, FONT_HEIGHT,
				TextureOptions.BILINEAR_PREMULTIPLYALPHA, getAssetManager(), FONT_USE, FONT_MEDIUM, true,
				android.graphics.Color.BLACK);
		font_Medium.load();

	}

	public void loadFontbig()
	{
		if (font_Big != null)
			return;

		font_Big = FontFactory.createFromAsset(getFontManager(), getTextureManager(), FONT_WIDTH, FONT_HEIGHT,
				TextureOptions.BILINEAR_PREMULTIPLYALPHA, getAssetManager(), FONT_USE, FONT_BIG, true,
				android.graphics.Color.BLACK);
		font_Big.load();
	}

}
